package com.godme.concurrent.util;

import java.util.concurrent.atomic.LongAccumulator;
import java.util.concurrent.atomic.LongAdder;

public class LongAddrTest {


    public static void main(String[] args) {
        LongAdder longAdder = new LongAdder();
        longAdder.add(1);

        LongAccumulator longAccumulator = new LongAccumulator(Long::sum, 1);
        longAccumulator.accumulate(5);
        System.err.println(longAccumulator.get());
        longAccumulator.accumulate(5);
        System.err.println(longAccumulator.get());

    }
}
